<?php
namespace app\common\validate;

use think\Validate;

class ProductCatValidate extends Validate{

    protected $rule = [
        'name'=>'require',    //名称可以相同 因为有分组
        'pid'=>'number',
    ];

    protected $message = [
        'name.require'=>'标题必填',
        'pid.number'=>'操作错误',
    ];

    protected $scene = [
        'add' => ['name','pid'],
        'edit' => ['name','pid'],
    ];
}